import request from '@/router/axios'

export function exportExcel(query) {
  return request({
    url: '/stm/swsthandworkcleanrecord/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

export function fetchList(query) {
  return request({
    url: '/stm/swsthandworkcleanrecord/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/stm/swsthandworkcleanrecord',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/stm/swsthandworkcleanrecord/details/' + id,
    method: 'get'
  })
}

export function getObjBack(id) {
  return request({
    url: '/stm/swsthandworkcleanrecord/' + id,
    method: 'get'
  })
}
export function delObj(id) {
  return request({
    url: '/stm/swsthandworkcleanrecord/' + id,
    method: 'delete'
  })
}

export function delsObj(id) {
  return request({
    url: '/stm/swsthandworkcleanrecord/batchCascadeDel',
    method: 'delete',
    data:id
  })
}

export function putObj(obj) {
  return request({
    url: '/stm/swsthandworkcleanrecord',
    method: 'put',
    data: obj
  })
}

export function getHandworkCleanRecord(param) {
  return request({
    url: "/stm/swsthandworkcleanrecord/getHandworkCleanRecord",
    method: "post",
    params: param
  });
}


//查看手工清出数据管理历史记录
export function queryPastRecords(param){
  return request({
    url: '/stm/swsthandworkcleanrecord/getLogById/'+param.id,
    method: 'get'
  })
}

//查看手工清出数据管理历史记录明细
export function queryPastRecordsDetail(param){
  return request({
    url: '/stm/swsthandworkcleanrecord/getLogChildById/'+param.id,
    method: 'get'
  })
}

export function getPeriods(query) {
  return request({
    url: '/check/xw_js_tvm/getPeriods',
    method: 'post',
    params: query
  })
}